package com.itmake.sample.tenant.mycat;

/**
 * 租户服务 保存租户信息
 *
 * @author Amjacks
 * @since 2021/04/21
 */
public class TenantService {

    private TenantService() {}

    private static final ThreadLocal<String> context = new ThreadLocal<>();

    public static void setTenantId(String tenantId) {
        context.set(tenantId);
    }

    public static String getTenantId() {
        return context.get();
    }

    public static void removeTenantId() {
        context.remove();
    }
}
